/*
 * Pipe.h
 *
 *  Created on: Mar 3, 2012
 *      Author: baneling
 */

#ifndef _PIPE_H_
#define _PIPE_H_
#include <cerrno>
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <cstdio>
using namespace std;

enum message_t {none, askState, ansState, drFound, cabFound, shift,okshift,noshift, unreadable,awayFromDoc,goToStop,sendFormationYaw,obstacles,drIsFree,goFormation};//per aggiunte fare l'associazione in pipe.cpp in strToEnum e enumToStr

struct message_s{
	double x;
	double y;
	enum message_t m_t;
	string sender;
	string receiver;
}typedef msg_t;

class Pipe {
	public:
		static msg_t readOnPipe(int inPipe);
		static size_t writeOnPipe(int outPipe,string sender, string receiver,enum message_t type,double x, double y);
		static string enumToStr(enum message_t m);
		static enum message_t strToEnum(string s);
	private: /*methods*/
		Pipe(){};
		virtual ~Pipe(){};
};



#endif /* PIPE_H_ */
